import http from '../index'

// 分页获取授信用户
export const getCredits = ({ ascended = null, current = null, size = null, sortFieldName = null, status = null, phone = null, userName = null }) => {
    return http.get("credits", { ascended, current, size, sortFieldName, status, phone, userName })
}

// 根据sid获取授信用户
export const getCreditDetail = ({ sid }) => {
    return http.get("credits/" + sid)
}

// 新增授信用户
export const addCredit = ({ alertLimit, totalMoney, userSid, note = null, status = null }) => {
    return http.post("credits", { alertLimit, totalMoney, userSid, note, status })
}

// 修改授信用户
export const editCredit = ({ sid, alertLimit, totalMoney, note = null }) => {
    return http.put("credits/" + sid, { alertLimit, totalMoney, note })
}

// 根据sid启用-停用授信用户
export const changeCreditStatus = ({ sid }) => {
    return http.put("credits/" + sid + '/status')
}



